package com.yunhe.option.service.data;

import com.yunhe.option.domain.data.SeasonPrice;
import com.yunhe.option.domain.data.SeasonPriceDetail;
import com.yunhe.common.exception.ArgumentErrorException;
import com.yunhe.common.exception.ObjectNotFoundException;
import com.yunhe.common.exception.UniqueConstraintsException;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public interface SeasonPriceService {

    SeasonPrice create(SeasonPrice seasonPrice, Long costPriceId) throws ArgumentErrorException, UniqueConstraintsException, ObjectNotFoundException;

    Iterable<SeasonPrice> create(List<SeasonPrice> list, Long costPriceId)
        throws ArgumentErrorException, UniqueConstraintsException, ObjectNotFoundException;

    void delete(Long seasonPriceId) throws ArgumentErrorException;

    void delete(List<SeasonPrice> list) throws ArgumentErrorException;

    SeasonPrice update(SeasonPrice seasonPrice) throws ArgumentErrorException, UniqueConstraintsException, ObjectNotFoundException;

    SeasonPrice update(Long id,
                       String title,
                       String runMonth,
                       List<Long> priceRates,
                       List<SeasonPriceDetail> details) throws ArgumentErrorException, UniqueConstraintsException, ObjectNotFoundException;

    Optional<SeasonPrice> findById(Long id);

    List<SeasonPrice> search(Long costPriceId);
}
